diff options
| author | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-08-05 21:16:45 +0100 |
|---|---|---|
| committer | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-08-05 21:37:58 +0100 |
| commit | 3098c31049e17dfdcdf451e843f6c4bdcf5b2fa1 (patch) | |
| tree | b3590c527d147db6ef5519d43e8a1976f9674f42 /src/pages/[locale] | |
| parent | 97147d56d93c7949fdccf22abe569b1b9d7a22ab (diff) | |
Moves to root folder
Diffstat (limited to 'src/pages/[locale]')
| -rw-r--r-- | src/pages/[locale]/index.astro | 60 | ||||
| -rw-r--r-- | src/pages/[locale]/staticPaths.ts | 10 |
2 files changed, 70 insertions, 0 deletions
diff --git a/src/pages/[locale]/index.astro b/src/pages/[locale]/index.astro new file mode 100644 index 0000000..23a270d --- /dev/null +++ b/src/pages/[locale]/index.astro @@ -0,0 +1,60 @@ +--- +import Layout from '../../layouts/Layout.astro'; +import staticPaths from './staticPaths'; +import translate from '../../i18n/translate'; +import site from '../../i18n/translations/site'; +import home from '../../i18n/translations/pages/home'; +import type Locale from '../../types/Locale'; + +export async function getStaticPaths() { return staticPaths; } + +const locale = Astro.params.locale as Locale; +const t = translate(locale); +--- + +<Layout locale={locale} title={ t(home, 'title') }> + <main id="main"> + <section> + <h1 class="title">{ t(site, 'title') }</h1> + <h1>Tap-level heidin</h1> + <h2>Seicont-level heidin</h2> + <h3>Third-level heidin</h3> + <h4>Fowert-level heidin</h4> + <p> + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. + </p> + <a class="link" href="#">Lairn mair!</a> + <p> + Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea + commodo consequat. + </p> + <button class="btn">Dae somethin excitin...</button> + <p> + Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. + </p> + </section> + <section> + <h2>Seicont-level heidin</h2> + <h3>Third-level heidin</h3> + <h4>Fowert-level heidin</h4> + <p> + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. + </p> + <a class="link" href="#">Lairn mair!</a> + <p> + Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea + commodo consequat. + </p> + <button class="btn">Dae somethin excitin...</button> + <p> + Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt + mollit anim id est laborum. + </p> + </section> + </main> +</Layout> diff --git a/src/pages/[locale]/staticPaths.ts b/src/pages/[locale]/staticPaths.ts new file mode 100644 index 0000000..266ad2c --- /dev/null +++ b/src/pages/[locale]/staticPaths.ts @@ -0,0 +1,10 @@ +import type Locale from '../../types/Locale'; + +// Defines what values to insert into the [locale] URL path parameter +// when generating a static site +const staticPaths: { params: { locale: Locale} }[] = [ + { params: { locale: 'sco' } }, + { params: { locale: 'en-GB' } }, +] + +export default staticPaths;
\ No newline at end of file |
